Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fulcon

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fulcon

Clones a function (creates wrapper function), with the same signature as source function

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37K
decreased by-6.96%
Maintainers
1
Weekly downloads
 
Created
Source

fulcon NPM Module

Clones a function (creates wrapper function), with the same signature as source function

PhantomJS Build Linux Build Windows Build

Coverage Status Dependency Status bitHound Overall Score

compressionsize
fulcon.js1.02 kB
fulcon.min.js673 B
fulcon.min.js.gz396 B

Install

$ npm install --save fulcon

Example

var fulcon = require('fulcon');

function original(a, b, c)
{
  return 42 + a + b + c;
}

assert.strictEqual(original.length, 3, 'signature of the original function has 3 arguments');
assert.strictEqual(original(1, 2, 3), 48, 'original function returns 48');

var cloned = fulcon(original);

assert.notStrictEqual(original, cloned, 'original and cloned functions are not the same function');

assert.strictEqual(cloned.length, 3, 'signature of the cloned function has 3 arguments');
assert.strictEqual(cloned(1, 2, 3), 48, 'cloned function returns 48');

Note: Beware of functions with side-effects! Cloned function calls original function under the hood, so it has same side-effects for better or for worst. Check test.js for details.

Want to Know More?

More examples can be found in test.js.

Or open an issue with questions and/or suggestions.

License

Fulcon is released under the MIT license.

Keywords

FAQs

Package last updated on 16 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc